<!--
*Author：
 *Contact：
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/PROC_MATERIAL.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/PROC_MATERIAL.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '物料维护',
                name: 'workbusiness/PROC_MATERIAL',
                url: "/PROC_MATERIAL/",
                sortName: "CreateOn"
            });
            const editFormFields = ref({"Identifier":"","MaterialNameZH":"","Description":"","WorkpieceCode":"","material":"","target_accuracy":"","workpiece_width":"","MaterialType":"","SupplierId":"","ManufacturType":"","PlanStart":"","PlanEnd":"","x_instance":"","y_instance":"","z_instance":"","Weight":"","SHELVES_Id":"","ceshi":"","location":"","Specification":"","Unit":"","Quantity":""});
            const editFormOptions = ref([[{"title":"物料编码","field":"Identifier","type":"text"},
                               {"title":"物料名称","field":"MaterialNameZH","type":"text"},
                               {"title":"物料描述","field":"Description","type":"text"},
                               {"title":"工件编号","field":"WorkpieceCode","type":"text"}],
                              [{"dataKey":"加工材质","data":[],"title":"材质","field":"material","type":"select"},
                               {"dataKey":"加工精度","data":[],"title":"目标精度","field":"target_accuracy","type":"select"},
                               {"title":"工件宽度","field":"workpiece_width","type":"text"},
                               {"dataKey":"物料类型","data":[],"title":"物料类型","field":"MaterialType","type":"select"}],
                              [{"dataKey":"供应商","data":[],"title":"供应商","field":"SupplierId","type":"select"},
                               {"dataKey":"制造类型","data":[],"title":"制造类型","field":"ManufacturType","type":"select"},
                               {"title":"计划开始时间","field":"PlanStart","type":"datetime"},
                               {"title":"计划结束时间","field":"PlanEnd","type":"datetime"}],
                              [{"title":"预设中心点x距离","field":"x_instance","type":"number"},
                               {"title":"预设中心点y距离","field":"y_instance","type":"number"},
                               {"title":"预设中心点z距离","field":"z_instance","type":"number"},
                               {"title":"重量","field":"Weight","type":"number"}],
                              [{"dataKey":"货架点(原材料)","data":[],"title":"货架点","field":"SHELVES_Id","type":"select"},
                               {"title":"预设中心点","field":"ceshi","type":"canvas"},
                               {"title":"位置","field":"location","disabled":true,"type":"number"}],
                              [{"title":"规格","field":"Specification"},
                               {"title":"单位","field":"Unit"},
                               {"title":"数量","field":"Quantity","type":"decimal"}]]);
            const searchFormFields = ref({"Identifier":"","Order_Id":""});
            const searchFormOptions = ref([[{"dataKey":"工单","data":[],"title":"工单","field":"Order_Id","type":"select"},{"title":"物料编码","field":"Identifier","type":"text"}]]);
            const columns = ref([{field:'Id',title:'Id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Identifier',title:'物料编码',type:'string',link:true,width:110,align:'left',sort:true},
                       {field:'Order_Id',title:'工单',type:'string',bind:{ key:'工单',data:[]},width:220,align:'left'},
                       {field:'MaterialNameZH',title:'物料名称',type:'string',width:110,align:'left'},
                       {field:'Description',title:'物料描述',type:'string',width:220,align:'left'},
                       {field:'SHELVES_Id',title:'货架点',type:'string',bind:{ key:'货架点(原材料)',data:[]},width:120,align:'left'},
                       {field:'workpiece_name',title:'模具名称',type:'string',width:220,align:'left'},
                       {field:'WorkpieceCode',title:'工件编号',type:'string',link:true,width:120,align:'left'},
                       {field:'SupplierId',title:'供应商',type:'string',bind:{ key:'供应商',data:[]},width:120,align:'left'},
                       {field:'CreateBy',title:'创建人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'更新人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'更新时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'逻辑删除  0/不删除  1/已删除',type:'bool',width:110,hidden:true,align:'left'},
                       {field:'ProcessRouteId',title:'工艺路线',type:'string',width:120,hidden:true,align:'left'},
                       {field:'workpiece_type',title:'工件型号',type:'string',width:220,hidden:true,align:'left'},
                       {field:'material',title:'材质',type:'string',bind:{ key:'加工材质',data:[]},width:220,align:'left'},
                       {field:'target_accuracy',title:'目标精度',type:'decimal',bind:{ key:'加工精度',data:[]},width:110,align:'left'},
                       {field:'machine',title:'加工机床',type:'int',width:80,require:true,align:'left'},
                       {field:'workpiece_length',title:'工件长度',type:'decimal',width:110,align:'left'},
                       {field:'workpiece_width',title:'工件宽度',type:'decimal',width:110,align:'left'},
                       {field:'workpiece_height',title:'工件高度',type:'decimal',width:110,align:'left'},
                       {field:'x_instance',title:'预设中心点x距离',type:'decimal',width:110,align:'left'},
                       {field:'y_instance',title:'预设中心点y距离',type:'decimal',width:110,align:'left'},
                       {field:'z_instance',title:'预设中心点z距离',type:'decimal',width:110,align:'left'},
                       {field:'MaterialType',title:'物料类型',type:'string',bind:{ key:'物料类型',data:[]},width:120,align:'left'},
                       {field:'Hardness',title:'硬度',type:'decimal',width:110,align:'left'},
                       {field:'ceshi',title:'预设中心点',type:'string',width:120,align:'left'},
                       {field:'ManufacturType',title:'制造类型',type:'string',bind:{ key:'制造类型',data:[]},width:120,align:'left'},
                       {field:'Img',title:'图',type:'img',width:220,align:'left'},
                       {field:'PlanStart',title:'计划开始时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'PlanEnd',title:'计划结束时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'StorageState',title:'入库状态',type:'string',bind:{ key:'工件入库状态',data:[]},width:110,align:'left'},
                       {field:'Weight',title:'重量',type:'decimal',width:110,align:'left'},
                       {field:'ToolFixtureCode',title:'夹具',type:'string',width:120,align:'left'},
                       {field:'location',title:'位置',type:'int',width:80,readonly:true,align:'left'},
                       {field:'workpiece_id',title:'workpiece_id',type:'int',width:80,require:true,align:'left'},
                       {field:'RfidCode',title:'RfidCode',type:'string',width:120,align:'left'},
                       {field:'Specification',title:'规格',type:'string',width:120,align:'left'},
                       {field:'Unit',title:'单位',type:'string',width:110,align:'left'},
                       {field:'Quantity',title:'数量',type:'decimal',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
